<?php
namespace app\index\controller;

use think\Db;

class Index
{
    public function index()
    {
        $trains=Db::name("train")
//            ->field("train_pic,train_name")
//            ->order("train_id desc")
            ->limit(2)
            ->where("train_status=1")
            ->select();
        $arr["data"]=$trains;
        $arr["code"]=1;
        $arr["msg"]="成功";
        return json_encode($arr,JSON_UNESCAPED_UNICODE);

    }
}
